package de.breitbeil.jbooking.util;

import java.util.Comparator;

import de.breitbeil.jbooking.domain.Booking;

public class BookingFromComparator implements Comparator<Booking> {

    public int compare(Booking o1, Booking o2) {
        if(o1 == null || o1.getFrom() == null) {
            return 1;
        }
        if(o2 == null || o2.getFrom() == null) {
            return -1;
        }
        
        return o1.getFrom().compareTo(o2.getFrom());
    }

}
